package com.itheima.Demo1;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestDemo2 {
    public static void main(String[] args) throws IOException {
        //创建字节输入流对象
        //创建字节输出流对象
        FileInputStream fis = new FileInputStream("b.txt");
        FileOutputStream fos = new FileOutputStream("c.txt");
        //创建一个字节数组
        byte[] bytes = new byte[1024];
        int len;
        while ((len = fis.read(bytes))!= -1){
            fos.write(bytes,0,len);
        }
        //释放资源
        fis.close();
        fos.close();
    }
}
